
<!doctype html>
<html class="no-js" lang="">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="x-ua-compatible" content="ie=edge">
    <title>商品列表</title>
    <meta name="description" content="">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <link rel="apple-touch-icon" href="apple-touch-icon.png">
    <!-- Place favicon.ico in the root directory -->

    <link rel="stylesheet" type="text/css" href="../../css/reset.css">
</head>


<body>
    <div class="loading">
        <span class="loadImg"></span>
    </div>
    <div class="peopleList">
        <div class="info">
            <ul>
                <li class="top">
                    <span class="id">id</span>
                    <span class="name">名称</span>
                    <span class="gender">性别</span>
                    <span class="count">积分</span>
                    <span class="last_login">最后登录时间</span>
                    <span class="last_ip">最后登录ip</span>
                    <span class='mobile'>手机号码</span>
                </li>
            </ul>
        </div>
    </div>
</body>
<script src="../../js/jquery.js"></script>
<script src="../../js/jquery.cookie.js"></script>
<script type="text/javascript">
    $(function(){
        
        getData();
        function getData(){
            var admintoken=$.cookie('admintoken');
            if(admintoken!=null){
                $('.loading').show();
                $.ajax({
                    type: 'get',
                    url:'http://www.math80.com/users',
                    headers:{Authorization:"Bearer "+admintoken},
                    success:function(data){
                        
                        var all=data.data;
                        var len=data.data.length;
                        for(var i=0;i<len;i++){
                            var _gender;
                            if(all[i].data.gender==1){
                                _gender='男';
                            }else{
                                _gender='女';
                            }
                            var li="<li>"+
                                        "<span class='id'>"+all[i].data.id+"</span>"+
                                        "<span class='name'>"+all[i].data.nickname+"</span>"+
                                        "<span class='gender'>"+_gender+"</span>"+
                                        "<span class='count'>"+all[i].data.integral_count+"</span>"+
                                        "<span class='last_login'>"+all[i].data.last_login_at+"</span>"+
                                        "<span class='last_login'>"+all[i].data.last_login_ip+"</span>"+
                                        "<span class='mobile'>"+all[i].data.mobile+"</span>"+
                                    "</li>";
                            $('.info ul').append(li);
                        }
                        $('.loading').hide();
                    }
                })
            }else{
                alert('请重新登录')
            }

        }


    })

</script>
</html>